<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var todolist = [{
            title: '好饿啊',
            dome: false
        }, {
            title: '真的好饿',
            dome: true
        }]
        // 本地存储数据内容必须是字符串 否则后台无法显示实际数据内容
        localStorage.setItem('todo', todolist)//[object object],[object object]
        // 此时需要用 JSON.stringify('数据本体') 转换为字符才可以在后台显示
        var data = localStorage.setItem('todo', JSON.stringify(todolist))


    </script>
</body>

</html>